package controller;

import lombok.Cleanup;
import lombok.val;
/**
 * @description: 这个关键字不用确定类型，运行时候动态指定。例子val map = new HashMap<String,String>();
 * @author: song
 * @date: 2022/11/30 7:43
 * @param:
 * @return:
 **/
import org.junit.Test;
import pojo.User;

import java.io.*;
import java.util.HashMap;

/**
 * @BelongsProject: Java_learning
 * @BelongsPackage: controller
 * @Author: song
 * @CreateTime: 2022-11-30  06:58
 * @Description: TODO
 * @Version: 1.0
 */

public class UserController {
    @Test
    public void testUser() throws FileNotFoundException {
        User user = new User();
        //User user = User.builder().build();
        user.setId(1);
        user.setName("song");
        user.setEmail("kobe@163.com");
        user.setPhone("1234567897");
        user.setSex('男');
        user.setPassword("123456");
        user.test("wangba");
        val map = new HashMap<String,String>();

        @Cleanup InputStream inputStream = new FileInputStream("Filepath");
        // @Cleanup这个注解将会在连接使用完毕后自动关闭连接，不需要写代码主动关闭，跟try-with-resource类似。
        System.out.println(user.toString());
    }
}
